﻿// 标准管理平台

namespace Passion.iWMS.Application;

/// <summary>
/// 3 出库动作
/// 3.1 发料请求
/// 上位系統請求自動倉進行發料出庫動作。
/// 
/// 存放完後,把所有相關數據上傳,確保正確性。
/// 若異常，則需要傳送錯誤代碼(EndCode)及錯誤原因(EndReason)；若完成入庫，錯誤代碼為0。 
/// 
/// API名稱: [POST] /api/ASRS/StockOutCommand
/// Host -> ASRS
/// </summary>
[SugarTable("ASRS_StockOutCommand", "发料请求")]
[IncreTable]
public class ASRS_StockOutCommand_3_1 : EntityBase
{
    /// <summary>
    /// 搬送命令代碼
    /// </summary>
    [SugarColumn(ColumnDescription = "搬送命令代碼", Length = 50, IsNullable = true)]
    [MaxLength(50)]
    public string CommandID { get; set; }
    /// <summary>
    /// 工單代碼
    /// </summary>
    [SugarColumn(ColumnDescription = "工單代碼", Length = 50, IsNullable = true)]
    [MaxLength(50)]
    public string WOID { get; set; }
    /// <summary>
    /// 線別
    /// </summary>
    [SugarColumn(ColumnDescription = "線別", Length = 50, IsNullable = true)]
    [MaxLength(50)]
    public string LineID { get; set; }
    /// <summary>
    /// 製程代碼
    /// </summary>
    [SugarColumn(ColumnDescription = "製程代碼", Length = 50, IsNullable = true)]
    [MaxLength(50)]
    public string OPCode { get; set; }
    /// <summary>
    /// 後製程代碼
    /// </summary>
    [SugarColumn(ColumnDescription = "後製程代碼", Length = 50, IsNullable = true)]
    [MaxLength(50)]
    public string NextOPCode { get; set; }
    /// <summary>
    /// True: Reel首捲料 ; False: Reel 補料
    /// </summary>
    [SugarColumn(ColumnDescription = "首卷料", Length = 50, IsNullable = true)]
    [MaxLength(50)]
    public string FirstReel { get; set; }
    /// <summary>
    /// Magazine內框尺寸(空框叫料使用)
    /// </summary>
    [SugarColumn(ColumnDescription = "Magazine內框尺寸(空框叫料使用)", Length = 50, IsNullable = true)]
    [MaxLength(50)]
    public string IntCarrierSize { get; set; }
    /// <summary>
    /// 出庫口代碼
    /// </summary>
    [SugarColumn(ColumnDescription = "出庫口代碼", Length = 50, IsNullable = true)]
    [MaxLength(50)]
    public string PortID { get; set; }
    /// <summary>
    /// 出庫模式
    /// FULL_ORDER --- 整套工單
    /// FIRST --- 首捲
    /// REFILL --- 補料
    /// REPACK --- 轉接料盤
    /// MANUAL --- 人工出庫
    /// </summary>
    [SugarColumn(ColumnDescription = "出庫模式", Length = 50, IsNullable = true)]
    [MaxLength(50)]
    public string Mode { get; set; }

    /// <summary>
    /// 是否上传
    /// </summary>
    [SugarColumn(ColumnDescription = "是否上传", Length = 50, IsNullable = true)]
    [MaxLength(50)]
    public string IsReport { get; set; }

    /// <summary>                                                                                                                                                                                                                                                                                                                       
    /// 备注
    /// </summary>
    [SugarColumn(ColumnDescription = "备注", Length = 5000, IsNullable = true)]
    [MaxLength(5000)]
    public string ReportRemarks { get; set; }

    /// <summary>
    /// 返回后是否处理
    /// </summary>
    [SugarColumn(ColumnDescription = "返回后是否处理", Length = 50, IsNullable = true)]
    [MaxLength(50)]
    public string IsResponse { get; set; }

    /// <summary>
    /// 返回消息体
    /// </summary>
    [SugarColumn(ColumnDescription = "返回消息体", Length = 50, IsNullable = true)]
    [MaxLength(50)]
    public string ResponseContent { get; set; }

}


public class ASRS_StockOutCommand_3_1_Input
{
    /// <summary>
    /// 搬送命令代碼
    /// </summary>
    public string CommandID { get; set; }
    /// <summary>
    /// 工單代碼
    /// </summary>
    public string WOID { get; set; }
    /// <summary>
    /// 線別
    /// </summary>
    public string LineID { get; set; }
    /// <summary>
    /// 製程代碼
    /// </summary>
    public string OPCode { get; set; }
    /// <summary>
    /// 後製程代碼
    /// </summary>
    public string NextOPCode { get; set; }
    /// <summary>
    /// True: Reel首捲料 ; False: Reel 補料
    /// </summary>
    public string FirstReel { get; set; }
    /// <summary>
    /// Magazine內框尺寸(空框叫料使用)
    /// </summary>
    public string IntCarrierSize { get; set; }
    /// <summary>
    /// 出庫口代碼
    /// </summary>
    public string PortID { get; set; }
    /// <summary>
    /// 出庫模式
    /// FULL_ORDER --- 整套工單
    /// FIRST --- 首捲
    /// REFILL --- 補料
    /// REPACK --- 轉接料盤
    /// MANUAL --- 人工出庫
    /// </summary>
    public string Mode { get; set; }

    /// <summary>
    /// 是否上传
    /// </summary>
    public string IsReport { get; set; }

    /// <summary>                                                                                                                                                                                                                                                                                                                       
    /// 备注
    /// </summary>
    public string ReportRemarks { get; set; }

    /// <summary>
    /// 返回后是否处理
    /// </summary>
    public string IsResponse { get; set; }

    /// <summary>
    /// 返回消息体
    /// </summary>
    public string ResponseContent { get; set; }

    public List<ASRS_StockOutCommand_Details_3_1_Input> BinList { get; set; }
}